<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>文件上传</title>
    <link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all">
    <script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layui-upload-drag" style="display: block;" id="ID-upload-demo-drag">
    <i class="layui-icon layui-icon-upload"></i>
    <div>点击上传，或将文件拖拽到此处</div>
<!--    <div class="layui-hide" id="ID-upload-demo-preview">-->
<!--        <hr> <img src="" alt="上传成功后渲染" style="max-width: 100%">-->
<!--    </div>-->
</div>
<script>
    layui.use(function(){
        var upload = layui.upload;
        var $ = layui.$;
        // 渲染
        upload.render({
            elem: '#ID-upload-demo-drag',
            url: '/student/batch',
            accept:'file',
            done: function(res){
                layer.msg(res.msg,function () {
                    var iframeIndex = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(iframeIndex);
                    // 重载表格
                    parent.layui.table.reload('currentTableId');
                })

            }
        });
    });
</script>
</body>
</html>